<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <!--{include file='comm/header.tpl'}-->
    <title>退款单详情</title>
    <style type="text/css">
        .items2 ul{ }
        .items2 ul li{margin-bottom: 10px;border: 1px solid #ffffff;height: 30px;line-height: 30px;padding: 0 5px;}
        .items2 ul li.selected {background-color: #E8F1FF;border: 1px solid #B2D1FF;box-shadow: 2px 2px 0 #E5E5E5;font-weight: bold;}
    </style>
</head>

<body>
<div style="width:100%">

    <!--{if isset($error_msg) && !empty($error_msg)}-->
        <div class="red" style="margin-top: 20px;text-align: center" ><!--{$error_msg}--></div>
    <!--{else}-->

    <div class="title">
        <h2 class="tac">
           <!--{$refund_info.refund_no}--> - 退款单详情
        </h2>
    </div>

    <div class="panel panel-default">
        <h2 class="panel-heading">退款单信息</h2>
        <div class="items2">
            <form id="refund_form" name="refund_form" onsubmit="return false;" >

            <table style="width: 100%;padding-bottom: 6px;margin-left: 0px;text-align: right" >
                <tbody>
                <tr>
                    <td style="width: 100px;font-weight:bold">退款单号：</td>
                    <td style="text-align: left">
                        <!--{$refund_info.refund_no}-->
                    </td>
                </tr>
                <tr>
                    <td style="width: 100px;font-weight:bold">创建时间：</td>
                    <td style="text-align: left">
                        <!--{$refund_info.createTime}-->
                    </td>
                </tr>
                <tr>
                    <td style="width: 100px;font-weight:bold">状态：</td>
                    <td style="text-align: left">
                        <!--{if $refund_info.refund_status == 1}-->
                        未审核
                        <!--{elseif $refund_info.refund_status == 2}-->
                        已审核
                        <!--{elseif $refund_info.refund_status == 3}-->
                        取消
                        <!--{else}-->
                        过账
                        <!--{/if}-->
                    </td>
                </tr>


                <tr>
                    <td style="width: 100px;font-weight:bold">订单编号：</td>
                    <td style="text-align: left"><!--{$refund_info.bill_code}-->
                        <input type="hidden" name="bill_no" id="bill_no" value="<!--{$refund_info.bill_code}-->">
                    </td>
                </tr>
                <tr>
                    <td style="width: 100px;font-weight:bold">退款来源：</td>
                    <td style="text-align: left">
                        <!--{if $refund_info.refund_source == 1}-->
                        订单退货
                        <!--{elseif $refund_info.refund_source == 2}-->
                        订单取消
                        <!--{elseif $refund_info.refund_source == 3}-->
                        其他
                        <!--{/if}-->
                        <input type="hidden" name="refund_source" id="refund_source" value="<!--{$refund_info.refund_source}-->">
                    </td>
                </tr>
                <tr>
                    <td id="td_return_no" style="width: 100px;font-weight:bold">退货单号：</td>
                    <td id="td_return_no_2" style="text-align: left">
                        <!--{$refund_info.return_no}-->
                        <input type="hidden" name="return_no" id="return_no" value="<!--{$refund_info.return_no}-->">
                    </td>
                </tr>

                <tr>
                    <td style="width: 100px;font-weight:bold">收款人：</td>
                    <td id="td_payee" style="text-align: left">
                        <!--{$refund_info.payee}-->
                    </td>
                </tr>

                <tr>
                    <td style="width: 100px;font-weight:bold">退款账号：</td>
                    <td id="td_refund_account" style="text-align: left">
                        <!--{$refund_info.refund_account}-->
                    </td>
                 </tr>
                <tr>
                    <td style="width: 100px;font-weight:bold">退款原因：</td>
                    <td id="td_refund_account" style="text-align: left">
                        <!--{$refund_info.reason_refund}-->
                    </td>
                </tr>

                <tr style="height: 30px;line-height: 30px;">
                    <td  style="width: 100px;font-weight:bold">开户行：</td>
                    <td  id="td_remark" style="text-align: left">
                        <!--{$refund_info.bank_deposit}-->
                    </td>
                </tr>
                <tr style="height: 30px;line-height: 30px;">
                    <td  style="width: 150px;font-weight:bold">银行卡归属城市：</td>
                    <td  id="td_remark" style="text-align: left">
                        <!--{$refund_info.to_city}-->
                    </td>
                </tr>
                <tr>
                    <td style="width: 100px;font-weight:bold">退款金额 ：</td>
                    <td id="td_refund_amount" style="text-align: left">
                        <!--{$refund_info.refund_amount}-->
                    </td>
                </tr>


                <tr>
                    <td style="width: 100px;font-weight:bold">环外费 ：</td>
                    <td id="td_refund_amount" style="text-align: left">
                        <!--{$freight}-->
                    </td>
                </tr>

                <tr>
                    <td style="width: 100px;font-weight:bold">配件费 ：</td>
                    <td id="td_refund_amount" style="text-align: left">
                        <!--{$accessories}-->
                    </td>
                </tr>

                <tr>
                    <td style="width: 100px;font-weight:bold">异地服务费 ：</td>
                    <td id="td_refund_amount" style="text-align: left">
                        <!--{$remote_service}-->
                    </td>
                </tr>

                <tr style="height: 30px;line-height: 30px;">
                    <td style="width: 100px;font-weight:bold">驳回原因：</td>
                    <td  id="td_reject_cause" style="text-align: left">
                        <!--{$refund_info.reject_cause}-->
                    </td>
                </tr>

                <tr style="height: 30px;line-height: 30px;">
                    <td  style="width: 100px;font-weight:bold">备注：</td>
                    <td  id="td_remark" style="text-align: left">
                        <!--{$refund_info.remark}-->
                    </td>
                </tr>
                </tbody>
            </table>
            </form>
        </div>
    </div>

    <!--已过账信息-->
    <!--{if $refunded_amount }-->
    <div class=" panel panel-default">
        <h2 class="panel-heading" id="m3">
            已过账信息
        </h2>
        <div class="items2">
            <table class="s" style="width: 98%;margin: 0 auto 8px;">
                <thead>
                <tr>
                    <th style="width: 15%;padding: 0;">关联退款单号</th>
                    <th style="width: 15%;padding: 0;">已过帐退款金额</th>
                </tr>
                </thead>

                <tbody>
                <!--{foreach from=$refunded_amount item=refunded}-->
                <tr>
                    <td class="tac"><!--{$refunded.refund_no}--></td>
                    <td class="tac"><!--{$refunded.refund_amount}--></td>
                </tr>
                <!--{/foreach}-->
                </tbody>

            </table>
        </div>
    </div>
    <!--{/if}-->

    <!--商品信息-->
    <!--{if $goods_array}-->
    <div class=" panel panel-default">
        <h2 class="panel-heading" id="m3">
            商品信息
        </h2>
        <div class="items2">
            <table class="s" style="width: 98%;margin: 0 auto 8px;">
                <thead>
                <tr>
                    <th style="width: 15%;padding: 0;">商品号</th>
                    <th >商品名称</th>
                    <th style="width: 13%;padding: 0;">规格</th>
                    <th style="width: 8%;padding: 0;">销售价</th>
                    <th style="width: 8%;padding: 0;">实售价</th>
                    <th style="width: 8%;padding: 0;">积分价</th>
                    <th style="width: 6%;padding: 0;">积分</th>
                    <th style="width: 8%;padding: 0;">购买数量</th>
                    <th style="width: 8%;padding: 0;">配件金额</th>
                </tr>
                </thead>

                <tbody>
                <!--{foreach from=$goods_array item=goods}-->
                <tr>
                    <td class="tac"><!--{$goods.goods_goodsID}--></td>
                    <td class="tal">
                        <!--{$goods.goods_name}-->
                    </td>
                    <td class="tal"><!--{$goods.goods_spec}--></td>
                    <td class="tar"><!--{$goods.goods_storePrice}--></td>
                    <td class="tar"><!--{$goods.goods_purchasePrice}--></td>
                    <td class="tar"><!--{$goods.goods_pointsPrice}--></td>
                    <td class="tar"><!--{$goods.goods_points}--></td>
                    <td class="tar"><!--{$goods.goods_amount}--></td>
                    <td class="tar"><!--{$goods.buyMoney}--></td>
                </tr>
                <!--{/foreach}-->
                </tbody>

            </table>
        </div>
    </div>
    <!--{/if}-->


    <!--代付订单商品信息-->
    <!--{if $other_goods_array}-->
    <div class=" panel panel-default">
        <h2 class="panel-heading" id="m3">
            代付订单商品信息
        </h2>
        <div class="items2">
            <table class="s" style="width: 98%;margin: 0 auto 8px;">
                <thead>
                <tr>
                    <th  style="width: 15%;padding: 0;">订单编号</th>
                    <th style="width: 15%;padding: 0;">商品号</th>
                    <th >商品名称</th>
                    <th style="width: 13%;padding: 0;">规格</th>
                    <th style="width: 8%;padding: 0;">销售价</th>
                    <th style="width: 8%;padding: 0;">实售价</th>
                    <th style="width: 8%;padding: 0;">积分价</th>
                    <th style="width: 6%;padding: 0;">积分</th>
                    <th style="width: 8%;padding: 0;">购买数量</th>
                    <th style="width: 8%;padding: 0;">配件金额</th>
                </tr>
                </thead>

                <tbody>
                <!--{foreach from=$other_goods_array item=other_goods}-->
                <tr>
                    <td class="tac"><!--{$other_goods.bill_code}--></td>
                    <td class="tac"><!--{$other_goods.goods_goodsID}--></td>
                    <td class="tal">
                        <!--{$other_goods.goods_name}-->
                    </td>
                    <td class="tal"><!--{$other_goods.goods_spec}--></td>
                    <td class="tar"><!--{$other_goods.goods_storePrice}--></td>
                    <td class="tar"><!--{$other_goods.goods_purchasePrice}--></td>
                    <td class="tar"><!--{$other_goods.goods_pointsPrice}--></td>
                    <td class="tar"><!--{$other_goods.goods_points}--></td>
                    <td class="tar"><!--{$other_goods.goods_amount}--></td>
                    <td class="tar"><!--{$other_goods.buyMoney}--></td>
                </tr>
                <!--{/foreach}-->
                </tbody>

            </table>
        </div>
    </div>
    <!--{/if}-->

    <!--操作日志-->
    <div class=" panel panel-default">
        <h2 class="panel-heading" id="m3">
            操作日志
        </h2>
        <div class="items2">
            <table class="s" style="width: 98%;margin: 0 auto 8px;">
                <thead>
                <tr>
                    <th style="width: 10%;padding: 0;">操作时间</th>
                    <th style="width: 13%;padding: 0;">操作人</th>
                    <th style="width: 10%;padding: 0;">退款单信息</th>
                    <th style="width: 15%;padding: 0;">操作类型</th>
                    <th style="width: 28%;padding: 0;">退款操作记录</th>
                    <th style="width: 8%;padding: 0;">退款状态</th>
                </tr>
                </thead>

                <tbody>
                <!--{foreach from=$refundLog item=refund_log}-->
                <tr >
                    <td style="text-align: center"><!--{$refund_log->createTime}--></td>
                    <td style="text-align: center"> <!--{$refund_log->creator}--> </td>
                    <td style="text-align: center"><!--{$refund_log->logItem}--></td>
                    <td style="text-align: center"><!--{$refund_log->extend_1}--></td>
                    <td style="text-align: center"><!--{$refund_log->extend_2}--></td>
                    <td style="text-align: center"><!--{if $refund_log->extend_5==1}-->未审核<!--{elseif $refund_log->extend_5==2}-->已审核<!--{elseif $refund_log->extend_5==3}-->取消<!--{else}-->过账<!--{/if}--> </td>
                </tr>
                <!--{/foreach}-->
                </tbody>

            </table>
        </div>
    </div>

    <div class="bottom_fixbox">
        <div class="tac" style="background: #dddddd;">
            <!--{if $refund == 1}-->
                <input type="button" class="btn btn-success" value="审核" onclick="bill.audit();" />&nbsp;&nbsp;&nbsp;&nbsp;
            <!--{/if}-->
            <input type="button" class="btn btn-default" value="关闭" onclick="E.closeWindows();" />
        </div>
    </div>

    <!--{/if}-->


</div>


<script type="text/javascript">

    $(function(){
        /**
         * 驳回原因、备注去除换行
         * @author   cdd <!--allen.qiang@fistforward.com-->
         */
       $("#td_remark").text($("#td_remark").text().replace(/[\r\n]/g,""));
       $("#td_reject_cause").text($("#td_reject_cause").text().replace(/[\r\n]/g,""));
    })
    var bill = {
        //审核
        audit : function (){
            E.confirm("您是否确认审核该退款单？","bill.confirmAudit");
        },
        //审核确认
        confirmAudit : function (){

            var refund_no = "<!--{$refund_info.refund_no}-->";

            E.ajax_post({
                url: "/invokingAjax-backend/bill/billRefund.ajax?operFlg=102",
                data: {
                    refund_no:refund_no
                },
                call: "bill.result"
            });

        },

        result : function (response){
            if(response.code != 200){
                E.alert(response.message);
                return;
            }else{
                E.opener("bill.search");

                E.alert("审核成功",2,"E.closeWindows");
            }

        },

        reload : function (){
            E.opener("bill.search");
        }

    };

</script>


</body>
</html>
